﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RIFT.Assets
{
    /// <summary>
    /// File from a RIFT Package.
    /// </summary>
    public class RiftPackageFile
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="T:RiftPackageFile"/> class.
        /// </summary>
        /// <param name="data">The file data.</param>
        public RiftPackageFile(byte[] data)
        {
            this.Data = data;
        }

        /// <summary>
        /// Gets or sets the file data.
        /// </summary>
        /// <value>The file data.</value>
        public byte[] Data
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the FourCC signature.
        /// </summary>
        /// <value>The FourCC signature.</value>
        public byte[] FourCC
        {
            get
            {
                if (Data.Length >= 4)
                {
                    return new byte[4] { Data[0], Data[1], Data[2], Data[3] };
                }

                return new byte[0];
            }
        }

        public RiftPackageFileHeader Header
        {
            get;
            set;
        }
    }
}
